#pragma once

#include <stdint.h>

class CPkgBuf
{
public:
    CPkgBuf();
    ~CPkgBuf();

    bool Init(uint32_t nMax);
    void Destroy();

    uint32_t GetLength() { return m_nSize; }
    uint8_t *GetData() { return m_pBuf; }
    uint8_t *GetWritePos() { return m_pBuf + m_nSize; }
    void SetLength(uint32_t nLen) { m_nSize = nLen; }

private:
    uint8_t *m_pBuf;
    uint32_t m_nSize;
};
